package com.huayi.datagovernance.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.huayi.datagovernance.common.SysConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import java.io.Serializable;
import java.util.Date;

/**
 * @author wuch
 * @version 1.0
 * @date 2021/4/8 14:38
 */
@Data
@TableName(value = "user",schema = SysConstant.DB_SCHEMA_SXYKTEST)
@ApiModel(value = "用户",description = "用户表模型")
public class User implements Serializable {

    @TableId(value = "id", type = IdType.ID_WORKER_STR)
    @ApiModelProperty(value = "id", notes = "主键")
    private String id;

    @ApiModelProperty(value = "name", notes = "名字")
    private String name;

    @ApiModelProperty(value = "age", notes = "年龄")
    @Range(min = 1, max = 150, message = "年龄必须在1-150之间")
    private Integer age;

    @ApiModelProperty(value = "createTime", notes = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "updateTime", notes = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "car", notes = "座驾信息")
    @Valid
    @TableField(exist = false)
    private Car car;

    @ApiModelProperty(value = "carPlateNumber", notes = "车牌号")
    private String carPlateNumber;

    @ApiModelProperty(value = "carBrand", notes = "车品牌")
    private String carBrand;
}
